package com.byd.model;

import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import com.byd.utils.Lg;

public class NotificationManager {
	private final Context mContext;
	private final android.app.NotificationManager mNotificationManager;
	private final PendingIntent mIntent;

	public NotificationManager(Context context) {
		mContext = context;
		mNotificationManager = (android.app.NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
		Intent intent = new Intent(/*context, OtaAppActivity.class*/);
		intent.setAction(Intent.ACTION_MAIN);
		intent.addCategory(Intent.CATEGORY_LAUNCHER);
		intent.setFlags(Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED | Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT
				| Intent.FLAG_ACTIVITY_NEW_TASK);
		mIntent = PendingIntent.getActivity(mContext, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
	}

	private String getString(int resId) {
		return mContext.getResources().getString(resId);
	}

	private String getString(int resId, String d) {
		return mContext.getResources().getString(resId, d);
	}

	private void remove() {
		mNotificationManager.cancel(1029);
	}

	@Override
	protected void finalize() throws Throwable {
		Lg.i("finalize: " + toString());
		super.finalize();
	}
}
